package com.rayboot.footpoint;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.rayboot.footpoint.activity.FindLocationOnMapActivity;
import com.rayboot.footpoint.activity.FootpointDetailEditActivity;
import com.rayboot.footpoint.activity.NewFootpointActivity;
import com.rayboot.footpoint.activity.SettingActivity;
import com.rayboot.footpoint.activity.ShowFootporinsOnMapActivity;
import com.rayboot.footpoint.activity.ViewFootpointActivity;

public class FootpointActivity extends Activity implements OnClickListener {

	private Button btnNew;
	private Button btnView;
	private Button btnSetting;
	private Button btnMore;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		btnNew = (Button) findViewById(R.id.btnMNew);
		btnView = (Button) findViewById(R.id.btnMView);
		btnSetting = (Button) findViewById(R.id.btnMSetting);
		btnMore = (Button) findViewById(R.id.btnMMore);

		btnNew.setOnClickListener(this);
		btnView.setOnClickListener(this);
		btnSetting.setOnClickListener(this);
		btnMore.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		Intent intent = new Intent();
		switch (v.getId()) {
		case R.id.btnMNew:
			intent.setClass(this, NewFootpointActivity.class);
			break;
		case R.id.btnMView:
			intent.setClass(this, ViewFootpointActivity.class);
			break;
		case R.id.btnMSetting:
			intent.setClass(this, FindLocationOnMapActivity.class);
			// intent.setClass(this, SettingActivity.class);
			break;
		case R.id.btnMMore:
			// intent.setClass(this, FootpointDetailEditActivity.class);
			intent.setClass(this, ShowFootporinsOnMapActivity.class);
			// intent.setClass(this, MoreActivity.class);
			break;
		default:
			break;
		}
		this.startActivity(intent);
	}
}